<?php


namespace app\admin\model\Video;



use think\facade\Db;
use think\Model;

class VideoGoodsRelationModel extends Model
{
    /**
     * 数据表名
     * @var string
     */
    protected $name = "video_goods_relation";

    /**
     * 根据条件查询多条
     * @param $where
     * @return array
     * @throws
     */
    public static function getVideoGoodsRelationWhereMore($where)
    {
        $list = Db::name('video_goods_relation')->where($where)->select()->toArray();
        return $list;
    }

    /**
     * 统计
     * @param $where
     * @return int
     */
    public static function getVideoGoodsRelationCountWhere($where)
    {
        $count = Db::name("video_goods_relation")->where($where)->count();
        return $count;
    }

    /**
     * 批量添加
     * @param $data
     * @return int
     */
    public static function addVideoGoodsRelation($data)
    {
        $flag = Db::name("video_goods_relation")->insertAll($data);
        return $flag;
    }

    /**
     * 删除
     * @param $where
     * @return int
     * @throws
     */
    public static function delVideoGoodsRelationWhere($where)
    {
        $flag = Db::name('video_goods_relation')->where($where)->delete();
        return $flag;
    }
}
